Skip to content

Conversation

@hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-2666

What's in this PR?

  • Reviews SWR call doesn't get triggered and I had to set the swr key only after its ready for the API call, isPaused is not re-triggering the API, it just skips the call.

isValidating: isValidatingChallengeReviews,
}: SWRResponse<BackendReview[], Error> = useSWR<BackendReview[], Error>(
`reviewBaseUrl/reviews/${challengeId}/${reviewerKey}`,
challengeId && (reviewerIds.length || shouldForceReviewFetch)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The change from using isPaused to conditionally setting the SWR key to undefined is a good approach to prevent unnecessary API calls. However, ensure that challengeId and reviewerIds are always correctly initialized before this point to avoid potential issues with undefined values.

@kkartunov kkartunov requested a review from vas3a December 17, 2025 08:45
@kkartunov
Copy link
Collaborator

@vas3a this looks good?

@kkartunov kkartunov merged commit 3795707 into dev Dec 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants